<%--
  Created by IntelliJ IDEA.
  User: shen
  Date: 2020/2/28
  Time: 17:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<script src="js/updateFormJs.js"></script>

<form class="form-horizontal" action="" method="post" id="updateSdfsQ">
    <c:if test="${sessionScope.sQByID.sdfsQuestions.questionType eq 1}">
        <input type="hidden" name="sQuestionID" value="${sessionScope.sQByID.sQuestionID}" />
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title">更新</h4>
        </div>
        <div class="modal-body">
            <div class="form-group">
                <label for="sQuestionID" class="col-sm-2 control-label">试题编号</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="sQuestionID" disabled value="${sessionScope.sQByID.sQuestionID}" />
                </div>
            </div>
    </c:if>
            <c:if test="${sessionScope.sQByID.sdfsQuestions.questionType eq 2}">
            <input type="hidden" name="dQuestionID" value="${sessionScope.sQByID.dQuestionID}" />
            <input type="hidden" name="questionType" value="${sessionScope.sQByID.sdfsQuestions.questionType}" />
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">更新</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label for="dQuestionID" class="col-sm-2 control-label">试题编号</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="dQuestionID" disabled value="${sessionScope.sQByID.dQuestionID}" />
                    </div>
                </div>
                </c:if>
                <c:if test="${sessionScope.sQByID.sdfsQuestions.questionType eq 3}">
                <input type="hidden" name="fQuestionID" value="${sessionScope.sQByID.fQuestionID}" />
                <input type="hidden" name="questionType" value="${sessionScope.sQByID.sdfsQuestions.questionType}" />

                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">更新</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label for="fQuestionID" class="col-sm-2 control-label">试题编号</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="fQuestionID" disabled value="${sessionScope.sQByID.fQuestionID}" />
                        </div>
                    </div>
                    </c:if>
                    <c:if test="${sessionScope.sQByID.sdfsQuestions.questionType eq 4 || sessionScope.sQByID.sdfsQuestions.questionType eq 5}">
                    <input type="hidden" name="shQuestionID" value="${sessionScope.sQByID.shQuestionID}" />
                    <input type="hidden" name="questionType" value="${sessionScope.sQByID.sdfsQuestions.questionType}" />

                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">更新</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <label for="shQuestionID" class="col-sm-2 control-label">试题编号</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="shQuestionID" disabled value="${sessionScope.sQByID.shQuestionID}" />
                            </div>
                        </div>
                        <%--<div class="form-group">
                            <label for="images" class="col-sm-2 control-label">试题涉及图片</label>
                            <div class="col-sm-10">
                                <input type="file" name="shQuestionImage"  id="images" value="${shQlist.shQuestionImage}">
                            </div>
                        </div>--%>
                        </c:if>
        <div class="form-group">
            <label for="question" class="col-sm-2 control-label">试题题干</label>
            <div class="col-sm-10">
                <input type="text" name="question" class="form-control" id="question"  value="${sessionScope.sQByID.sdfsQuestions.question}" required/>
            </div>
        </div>

        <div class="form-group">
            <label for="difficulty2" class="col-sm-2 control-label">难度</label>
            <div class="col-sm-10">
                <select name="difficulty" class="form-control" id="difficulty2" required>
                    <option value="0.25" ${sessionScope.sQByID.sdfsQuestions.difficulty eq 0.25? "selected":""}>0.25</option>
                    <option value="0.5" ${sessionScope.sQByID.sdfsQuestions.difficulty eq 0.5?"selected":""}>0.5</option>
                    <option value="0.75" ${sessionScope.sQByID.sdfsQuestions.difficulty eq 0.75?"selected":""}>0.75</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><font color="red"></b>*</font>&nbsp;知识点</label>
            <div class="col-sm-10">
                <select id="quest"  name="levKldID"    required="true" size="5" style="margin-left:10px;width:100px;" onchange="changeLevKld(this)">

                </select>

                <select id="secKldIDFrom" size="5" name="secKldIDFrom" required="true"  style="width:100px;" multiple="multiple" onclick="addSecKld(this)">
                    <option>--不限--</option>
                </select>
                <span style="float: right;margin-right: 70px;">
                    <button type="button" class="btn btn-sm btn-info"style="display: flex;margin-right:20px;margin-top:10px;margin-bottom: 10px" onclick="addSecTo('secKldIDFrom','secKldIDTo','请选择需要添加的知识点')">添加>></button>
                    <button type="button" class="btn btn-sm btn-danger"style="float: left;margin-right: 3px" onclick="delSec('secKldIDTo','请选择需要删除的知识点')">删除<<</button>
                    <select id="secKldIDTo" size="5" name="secKld" required="true"  style="width:100px;margin-right:20px;margin-top:-50px;float: right" multiple="multiple" onclick="addSecKld(this)">
                        <option>--不限--</option>
                        <c:forEach var="sQSecKld" items="${sQSecKldList}">
                            <option value="${sQSecKld.secKldID}">${sQSecKld.secKldCtgr}</option>
                        </c:forEach>
                    </select>
               </span>

            </div>
        </div>
        <c:if test="${sessionScope.sQByID.sdfsQuestions.questionType eq 1}">
        <div class="form-group">
            <label for="optionA" class="col-sm-2 control-label">选项A</label>
            <div class="col-sm-10">
                <input type="text" name="optionA" class="form-control" id="optionA" value="${sessionScope.sQByID.optionA}"/>
            </div>
        </div>
        <div class="form-group">
            <label for="optionB" class="col-sm-2 control-label">选项B</label>
            <div class="col-sm-10">
                <input type="text" name="optionB" class="form-control" id="optionB" value="${sessionScope.sQByID.optionB}" required/>
            </div>
        </div>
        <div class="form-group">
            <label for="optionC" class="col-sm-2 control-label">选项C</label>
            <div class="col-sm-10">
                <input type="text" name="optionC" class="form-control" id="optionC" value="${sessionScope.sQByID.optionC}" required/>
            </div>
        </div>
        <div class="form-group">
            <label for="optionD" class="col-sm-2 control-label">选项D</label>
            <div class="col-sm-10">
                <input type="text" name="optionD" class="form-control" id="optionD" value="${sessionScope.sQByID.optionD}" required/>
            </div>
        </div>
        <div class="form-group">
            <label for="optionE" class="col-sm-2 control-label">选项E</label>
            <div class="col-sm-10">
                <input type="text" name="optionE" class="form-control" id="optionE" value="${sessionScope.sQByID.optionE}" required/>
            </div>
        </div>

        <div class="form-group">
            <label for="sCorrect" class="col-sm-2 control-label">正确答案</label>
            <div class="col-sm-10">
                <select name="sCorrect" id="sCorrect" class="form-control" required>
                    <option value="A" ${fn:trim(sessionScope.sQByID.sCorrect) eq 'A'? "selected":""}>A</option>
                    <option value="B" ${fn:trim(sessionScope.sQByID.sCorrect) eq 'B'? "selected":""}>B</option>
                    <option value="C" ${fn:trim(sessionScope.sQByID.sCorrect) eq 'C'? "selected":""}>C</option>
                    <option value="D" ${fn:trim(sessionScope.sQByID.sCorrect) eq 'D'? "selected":""}>D</option>
                    <option value="E" ${fn:trim(sessionScope.sQByID.sCorrect) eq 'E'? "selected":""}>E</option>
                </select>
            </div>
        </div>
      </div>
    </c:if>
    <c:if test="${sessionScope.sQByID.sdfsQuestions.questionType eq 2}">
        <div class="form-group">
            <label for="dCorrect" class="col-sm-2 control-label">正确答案</label>
            <div class="col-sm-10">
                <select name="dCorrect" id="dCorrect" class="form-control" required>
                    <option value="T" ${fn:trim(sessionScope.sQByID.dCorrect) eq 'T'? "selected":""}>T</option>
                    <option value="F" ${fn:trim(sessionScope.sQByID.dCorrect) eq 'F'? "selected":""}>F</option>
                </select>
            </div>
        </div>
      </div>
    </c:if>
        <c:if test="${sessionScope.sQByID.sdfsQuestions.questionType eq 3}">
            <div class="form-group">
                <label for="fCorrect" class="col-sm-2 control-label">正确答案</label>
                <div class="col-sm-10">
                    <input type="text" name="fCorrect" class="form-control" id="fCorrect" value="${sessionScope.sQByID.fCorrect}" required/>
                </div>
            </div>
          </div>
        </c:if>
        <c:if test="${sessionScope.sQByID.sdfsQuestions.questionType eq 4 || sessionScope.sQByID.sdfsQuestions.questionType eq 5}">
            <div class="form-group">
                <label for="shCorrect" class="col-sm-2 control-label">正确答案</label>
                <div class="col-sm-10">
                    <input type="text" name="shCorrect" class="form-control" id="shCorrect" value="${sessionScope.sQByID.shCorrect}" required/>
                </div>
            </div>
         </div>
        </c:if>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <c:if test="${sessionScope.sQByID.sdfsQuestions.questionType eq 1}">
            <button type="button" class="btn btn-primary" onclick="updateSave(${sessionScope.sQByID.sQuestionID})">保存</button>
        </c:if>
        <c:if test="${sessionScope.sQByID.sdfsQuestions.questionType eq 2}">
            <button type="button" class="btn btn-primary" onclick="updateSave(${sessionScope.sQByID.dQuestionID})">保存</button>
        </c:if>
        <c:if test="${sessionScope.sQByID.sdfsQuestions.questionType eq 3}">
            <button type="button" class="btn btn-primary" onclick="updateSave(${sessionScope.sQByID.fQuestionID})">保存</button>
        </c:if>
        <c:if test="${sessionScope.sQByID.sdfsQuestions.questionType eq 4 || sessionScope.sQByID.sdfsQuestions.questionType eq 5}">
            <button type="button" class="btn btn-primary" onclick="updateSave(${sessionScope.sQByID.shQuestionID})">保存</button>
        </c:if>
    </div>
</form>
